//-------------------------------------------------------------------
//	Copyright (c) 2010-2012  Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_WIN_SPLASH_WINDOW_H
#define _UX_WIN_SPLASH_WINDOW_H

#include <Includes.h>

#ifdef PLATFORM_WINDOWS

namespace Engine
{
namespace CoreSystems
{

	//
	// Splash Window
	//

	class _EXPORT_ CSplash : public CEngBaseObject
	{
	private:
		HWND			_hWnd;
		HBITMAP			_hBmp;

		CCore		*	_pCore;

		TThread			_sThread;

		irect			_sArea;

		const bool		_bTopMost;

		bool _CreateWindow();
		void _DestroyWindow();
		static uint CALLBACK _s_ThreadProc(void *pParametr);

	public:
		CSplash(bool bTopmost);
		~CSplash();

		bool LoadImage(uint16 uImageId, const uvec2 &vDim);
		bool LoadImage(const char *pFileName, const uvec2 &vDim);

		bool SetImage(HBITMAP pImage, const irect &sArea, bool bCenter = true);
		//void SetOwner(void *pOwner);

		void Show();

		// CEngBaseObject //
		void Release();
	};

//-------------------------------------------------------------------

}	// CoreSystems
}	// Engine

#endif	// PLATFORM_WINDOWS

#endif	// _UX_WIN_SPLASH_WINDOW_H